
package com.oahcfly.chgame.test.ui;

import java.util.HashMap;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.oahcfly.chgame.core.annotations.CHExmlBaseSkinUIAnnotation;
import com.oahcfly.chgame.core.listener.CHClickListener;
import com.oahcfly.chgame.core.listener.CHExmlListener;
import com.oahcfly.chgame.egret.ui.EXMLBaseSkinUI;
import com.oahcfly.chgame.util.CHLog;

@CHExmlBaseSkinUIAnnotation(exmlPath = "exml/StartUISkin.exml", resPath = "exml/res")
public class ExmlUITest2 extends EXMLBaseSkinUI implements CHExmlListener{
	public Actor btnExitGame;

	public ExmlUITest2 () {
		super("test2");
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createChildComplete () {
		// TODO Auto-generated method stub

		this.setExmlListener(this);
		CHLog.log("延迟执行，start="+System.currentTimeMillis());
		delayExecuteMethod(1, "delayrun");
	}
	
	public void delayrun(){
		CHLog.log("延迟执行，end="+System.currentTimeMillis());
	}

	@Override
	public void addClickListener (CHClickListener chClickListener) {
		// TODO Auto-generated method stub
		btnExitGame.addListener(chClickListener);
	}

	@Override
	public void uiClicked (Actor actor) {
		// TODO Auto-generated method stub

		if (actor == btnExitGame) {
			dismiss();
		}
	}

	@Override
	public void handleUIEvent (HashMap<String, String> data) {
		// TODO Auto-generated method stub

	}

	@Override
	public void clickBackKey () {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onDismiss () {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onShowFront () {
		// TODO Auto-generated method stub
		
		CHLog.log("onShowFront"+getStage());
	}
 

}
